package util;

import java.io.File;
import java.util.ArrayList;

import app.AppGlobals;

public class UtilHandler {
	
	public static String[] getDeckList(){
		File folder = new File(AppGlobals.launcherConfig.launcherDir + "/deck");
		if(!folder.exists()) return new String[0];
		ArrayList<String> deckList = new ArrayList<String>();
		deckList.add("");
		for (File fileEntry : folder.listFiles()) {
			if(fileEntry.getName().endsWith(".ydk")){
				String deckName = fileEntry.getName().replace(".ydk", "");
				deckList.add(deckName);
			}
				        
		}
		
		if(deckList.isEmpty())
			return null;
		else
			return deckList.toArray(new String[deckList.size()]);

	}

}
